<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-10-19 10:23:17
 * @Description: 订单退货表
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-19 18:03:25
 * @FilePath: /归档/base/2021_10_19_102317_create_order_return_good.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrderReturnGood extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_return_goods', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->foreignId('user_id')->default(0)->comment('购买人');
            $table->foreignId('order_id')->default(0)->comment('订单ID');
            $table->foreignId('good_id')->default(0)->comment('商品ID');
            $table->string('good_title', 100)->comment('商品名称');
            $table->string('good_thumb', 100)->comment('商品封面图');
            $table->foreignId('good_spec_id')->default(0)->comment('商品规格ID');
            $table->string('good_spec_title', 100)->nullable()->comment('商品规格名称');
            $table->unsignedInteger('nums')->default(0)->comment('数量');
            $table->unsignedDecimal('price')->comment('单价');
            $table->unsignedDecimal('integral_price')->default(0)->comment('积分优惠金额');
            $table->unsignedDecimal('coupon_price')->default(0)->comment('券优惠金额');
            $table->unsignedDecimal('real_price')->default(0)->comment('优惠后单价');
            $table->unsignedDecimal('wx_money')->default(0)->comment('微信退款金额');
            $table->unsignedDecimal('yue_money')->default(0)->comment('余额退款金额');
            $table->dateTime('wx_at')->default('2021-10-10 00:00:00')->comment('微信退款时间');
            $table->dateTime('yue_at')->default('2021-10-10 00:00:00')->comment('余额退款时间');
            $table->string('user_mark', 255)->nullable()->comment('用户备注');
            $table->string('shop_mark', 255)->nullable()->comment('商家备注');
            $table->tinyInteger('status')->default(0)->comment('状态  -1驳回 0待审核 1审核成功，退款中  2退款完成');
            $table->tinyInteger('del_flag')->default(0)->comment('删除状态（1删除 0正常）');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_return_goods');
    }
}
